package com.ll.xiaonew.commons.core.context;


import com.ll.xiaonew.commons.core.dto.UserToken;

/**
 * @author new
 * @date 2022/12/8 16:46
 */
//保存当前登录用户信息
public class UserContextHander {
    private static ThreadLocal<UserToken> threadLocal = new ThreadLocal<>();

    public static void set(UserToken userToken){
        threadLocal.set(userToken);
    }

    public static UserToken get(){
        return threadLocal.get();
    }

    public static void deleteToken(){
        threadLocal.remove();
    }
}
